<template>
  <div>
    <p class="bread_nav">
      您现在的位置是：<span
        class="bread-style"
        @click="clickFn('/')"
      >首页</span>><span @click="clickFn('/' + routers)">{{ location }}</span>
    </p>
  </div>
</template>

<script>
export default {
  props: {
    location: {
      type: String,
      default: ''
    },
    routers: {
      type: String,
      default: ''
    }
  },
  methods: {
    clickFn(path) {
      this.$router.push({
        path: path
      })
      if (path !== '/') {
        this.$emit('getData')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.bread_nav {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #949494;
  background: url(../assets/weizhi.png) no-repeat left center;
  background-size: 20px;
  padding-left: 30px;
  .bread-style {
    color: #518f97;
    padding-right: 5px;
  }
  span {
    cursor: pointer;
    padding-left: 5px;
  }
}
</style>
